<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        /**
                 * 预解析定义与赋值分来看|定义时函数定义与变量定义会先完成变量成为undefined函数有函数体(在识别到调用语句时)|立即执行函数中看作新的
        作用域
                */
        foo()
        var a = 200

        let poi = 123
        function foo() {
            bar();
            (function () {
                var a = 400
                var b = 'duck'
                var f = 1234

                console.log(a)
            })()
            console.log(a)
            var a = 300;
            let poi = 234
            function bar(params) {
                var z = 200
                var s = 300
                console.log(a);
            }


        }
    </script>
</body>

</html>